function Person (name, age, gender) {
  var per = new Object();
  per.name = name;
  per.age = age;
  per.gender = gender;
  per.sayName = function () {
    console.log(this.name);
  }
  return per;
}
function Dog (name, age, gender) {
  var dog = new Object();
  dog.name = name;
  dog.age = age;
  dog.gender = gender;
  dog.sayName = function () {
    console.log(this.name);
  }
  return dog;
}
var p1 = Person("terry", 11, "male");
console.log(p1)
var p2 = Person("larry", 12, "male");
console.log(p2)
var d1 = Dog('erha', 2, "male")
console.log(d1)

console.log(typeof (p1));
console.log(typeof (d1));